package com.yingxin.yx.framework.tool.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 规格宽度枚举
 * 注意：用于宽度判断
 */

public enum SpecWdithEnums {

    METER_ONE("1000", "一米宽"),
    METER_TWO("1200", "一米二宽"),
    ;

    private String width;

    private String widthName;

    SpecWdithEnums(String width, String widthName) {
        this.width = width;
        this.widthName = widthName;
    }


    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getWidthName() {
        return widthName;
    }

    public void setWidthName(String widthName) {
        this.widthName = widthName;
    }

    public static SpecWdithEnums getEnum(String width) {
        if ( StringUtils.isBlank( width ) ) {
            return null;
        }
        for ( SpecWdithEnums i : SpecWdithEnums.values() ) {
            if ( i.getWidth().equals( width ) ) {
                return i;
            }
        }
        return null;
    }

}
